//
//  NetwokTool+status.swift
//  Weibo
//
//  Created by 唐润欣 on 16/6/19.
//  Copyright © 2016年 唐润欣. All rights reserved.
//

import Foundation

//  微博网络数据处理

//如果在定义数组时，遇到此问题：Type of expression is ambiguous without more context
//数组元素本身的值的类型，无法确定，则数组的类型也无法确定

extension NetworkTool {
    
    func loadStatus(since_id: Int64 = 0, max_id: Int64 = 0, callBack: ([String: AnyObject]?) ->()) {
        
        let url = "https://api.weibo.com/2/statuses/home_timeline.json"
        
        if let accessToken = UserAccount.sharedUserAccount.access_token {
            
            let parameters = ["access_token": accessToken, "since_id": "\(since_id)", "max_id": "\(max_id)"]
            
            request(url, method: .GET, parameters: parameters, callBack: { (
                response: [String: AnyObject]?) -> () in
                
                callBack(response)
            })
        }
    }
}
